<?php include 'head.php'; ?>
<?php
$gh = mysql_fetch_array(mysql_query("select name from salus_hospital_list where hospital_id = $hid ")) or die(mysql_error());
$hospital_name = $gh['name'];
?>
<title>Access Patient folder</title>

<body>
    <div id="wrapper">
        <div id="header_small"></div>
        <?php include 'menu.php'; ?>
        <div class="salus_bank_reg float_left">
            <h2>Welcome,  <?= $hospital_name ?>...!!!</h2><div class="down_arrow"></div>
            <div class="clear"></div>                
            <div class="float_left top_menu "><a href="access">Access Patient Folders</a></div>            
            <div class="clear"></div>
            <hr>
            <div id="mainContent">   
                <?php if ($_GET['e'] == 'u'): ?>
                    <div style="color: red; text-align: center; ">
                        <b>Error : </b> User Name not founded.
                    </div>
                <?php endif; ?>
                <?php if ($_GET['e'] == 'p'): ?>
                    <div style="color: red; text-align: center; ">
                        <b>Error : </b> Invalid password.
                    </div>
                <?php endif; ?>
                <?php if ($_GET['e'] == 's'): ?>
                    <div style="color: green; text-align: center; ">
                        <b>Congratulation : </b> Login Accepted.
                    </div>
                <?php endif; ?>
                <table>                    
                    <tr>
                        <td>Select Account Type :</td>
                        <td>
                            <select>
                                <option>SalusMe</option>
                                <option>SalusBank</option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td>Enter User Name :</td>
                        <td><input type="text" name="uname" placeholder="Patient's user Name" /></td>
                    </tr>
                    <tr>
                        <td>Password : </td>
                        <td><input type="password" name="pass" placeholder="password for folder"   /></td>
                    </tr>
                </table>
            </div>

            <div id="dialog" title="Send New File" >
                <p>
                <form id="uploader" name="uploader" method="post" action="upload_file.php" enctype="multipart/form-data" >
                    <table>
                        <tr>
                            <td>File Name :</td>
                            <td><input type="text" placeholder="File Title" name="title" required /></td>
                        </tr>                                                
                        <tr>
                            <td>File :</td>
                            <td><input type="file"  name="uploadedfile" required /></td>
                        </tr>                                                
                        <tr>
                            <td>Send to :</td>
                            <td><input type="text" placeholder="User Name" name="user_name" required /></td>
                        </tr>                                                
                        <tr>
                            <td><input type="hidden" name="MAX_FILE_SIZE" value="100000000000" /></td>
                            <td><input type="submit" value="Send File" /></td>
                        </tr>
                    </table>

                </form>
                </p>
            </div>
            <div id="dialog1" title="Modify Hospital Details">
                <form method="post" action="updt.php" >
                    <table>
                        <?php
                        $query1 = mysql_query("select * from salus_hospital_list where hospital_id = $hid") or die(mysql_error());
                        while ($row1 = mysql_fetch_array($query1)) {
                            ?>
                            <tr>
                                <td>Hospital Name :</td>
                                <td><input type="text" placeholder="Hospital Name" name="name" value="<?= $row1['name'] ?>" required /></td>
                            </tr>
                            <tr>
                                <td>Hospital Person :</td>
                                <td><input type="text" placeholder="Person name" name="person" value="<?= $row1['person'] ?>" required /></td>
                            </tr>
                            <tr>
                                <td>Email:</td>
                                <td><input type="text" placeholder="Email" name="email" value="<?= $row1['email'] ?>" required /></td>
                            </tr>
                            <tr>
                                <td>Phone :</td>
                                <td><input type="text" placeholder="Phone number" name="phone" value="<?= $row1['phone'] ?>" required /></td>
                            </tr>
                            <tr>
                                <td>Country :</td>
                                <td>
                                    <select name="country" style="width: 175px;" required >
                                        <?php
                                        $n1 = mysql_query("select * from fa_country");
                                        while ($nation1 = mysql_fetch_array($n1)) {
                                            ?>
                                            <option <?php if ($row1['country'] == $nation1['id']) echo 'selected'; ?>  value="<?= $nation1['id'] ?>" ><?= $nation1['name'] ?></option>  
                                        <?php } ?>
                                    </select>
                                </td>
                            </tr>
                            <tr>
                                <td><input type="hidden" name="sr" value="<?= $row1['sr'] ?>" /></td>
                                <td><input type="submit" value="Update Info" /></td>
                            </tr>
                        <?php }
                        ?>
                    </table>
                </form>
            </div>


        </div><!-- wrapper over    -->

        <?php include 'right_menu.php'; ?>

</body>
</html>